/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pbdedfld.hpp - PegBiDiEditField class definition.
//
// Author: Kalpesh Balar
//
// Copyright (c) 1997-2000 Swell Software
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
// This class allows user to edit text in both direction
// That is Right to Left or Left To Right.
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#if defined (PEG_BIDI_SUPPORT)

#ifndef _PEGBIDIEDITFLD_
#define _PEGBIDIEDITFLD_

class PegBiDiEditField : public PegEditField
{
    public:

        PegBiDiEditField(const PegRect &Rect,
                     PEGUINT StringId = 0,
                     PEGUSHORT Id = 0,
                     PEGULONG Style = FF_RECESSED|AF_ENABLED|EF_EDIT,
                     PEGINT Len = -1);

        PegBiDiEditField(const PEGCHAR *pText,
                     const PegRect &Rect,
                     PEGUSHORT Id = 0,
                     PEGULONG Style = FF_RECESSED|AF_ENABLED|EF_EDIT,
                     PEGINT Len = -1);

        virtual ~PegBiDiEditField();

        void CopyToScratchPad(void);

        virtual void DataSet(const PEGCHAR *Text);

        void DeleteMarkedText(void);
        virtual void Draw(const PegRect &Invalid);

        void PasteFromScratchPad(void);

    protected:
        virtual void AdvanceCursor(PEGINT New);

       #ifdef PEG_KEYBOARD_SUPPORT
        PEGBOOL CheckControlKey(PEGINT Key, PEGINT Flags);
       #endif

        virtual void ConvertToRTLArray(PEGCHAR *Text);
        virtual void CreateDispArray(const PEGCHAR *Text);
        virtual void DrawMarked(void);
        virtual PEGBOOL InsertKey(PEGINT Key);
        virtual void ReplaceMarkedText(PEGINT Key);
        virtual void RetardCursor(PEGINT New);
        virtual void SetCursorPos(PegPoint PickPoint);

        PEGCHAR *mpDispText;
};


#endif
#endif

